import javax.swing.JFrame;

import org.antlr.runtime.ANTLRFileStream;
import org.antlr.runtime.CommonTokenStream;

import AST.Start;
import Antlr.logo3Lexer;
import Antlr.logo3Parser;
import Tools.Env;
import Tools.Mem;


public class Main {
	public static void main(String args[]) throws Exception {
		
		JFrame frame = new JFrame();
		frame.setTitle("LogoLanguage");
		
		
//        logoLexer_old lex = new logoLexer_old(new ANTLRFileStream(args[0]));
//        CommonTokenStream tokens = new CommonTokenStream(lex);
// 
//        logoParser_old parser = new logoParser_old(tokens);
//        Start r = parser.start();
//        
//        Env e = new Env();
//        Mem m = new Mem();
//        r.eval(e, m);
        
		//logo3Lexer lex = new logo3Lexer(new ANTLRFileStream(args[0]));
		
		// Lecture du fichier...
		logo3Lexer lex = new logo3Lexer(new ANTLRFileStream("myProg_Proc.txt"));
        CommonTokenStream tokens = new CommonTokenStream(lex);

        logo3Parser parser = new logo3Parser(tokens);
        
        // On demarre le parsing
        Start r = parser.start();

        // Initialisation des environnements
        Env e = new Env();
        Mem m = new Mem();
        e.extend("posX", m.extend(0));
        e.extend("posY", m.extend(0));
        e.extend("alpha", m.extend(90));
        r.eval(e, m);
        
    }
}
